/*
 * @Author: 18059301505 275895816@qq.com
 * @Date: 2022-11-30 20:40:08
 * @LastEditors: 18059301505 275895816@qq.com
 * @LastEditTime: 2023-02-14 11:11:00
 * @FilePath: \sd365-permission-centre-front-end\src\api\administrative\administrative.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
// <!--
//  * @Author: abel.han
//  * @Date: 2022-7-09 11:45:25
//  * @LastEditTime: 2022-7-09 11:45:25
//  * @LastEditors: hpl
//  * @Description: In User Settings Edit
//  * @FilePath: /sd365-tms-omp-front-end/src/api/administrative/administrative.js
// -->
// eslint-disable-next-line quotes
// eslint-disable-next-line quotes
import request from '@/utils/request'

const ADMINISTRATIVE_URL = '/v1/administrative'
/**
 * 增加区划
 * @param {} 区域 DTO
 * @return: 成功则true CommonResponse 应答码和消息统一参考基础框架
 */
export function addAdministrative(administrativeDTO) {
  return request({
    url: ADMINISTRATIVE_URL,
    method: 'post',
    data: administrativeDTO,
  })
}
/**
 * 删除区划
 * @param {long} id 主键id 后端雪花算法生成
 * @param {long} version  版本号每次更新加1
 * @return: 成功则true CommonResponse 应答码和消息统一参考基础框架
 */
export function removeAdministrative(id, version) {
  return request({
    url: ADMINISTRATIVE_URL,
    params: { id: id, version: version },
    method: 'delete',
  })
}
/**
 * 修改区划
 * @param {区域DTO对象} administrativeDTO 区划对象参考后端接口
 * @return: 成功则true CommonResponse 应答码和消息统一参考基础框架
 */
export function modifyAdministrative(administrativeDTO) {
  return request({
    url: ADMINISTRATIVE_URL,
    method: 'put',
    data: administrativeDTO,
  })
}
/**
 *  批量删除区域，一般用于界面勾选多条记录调用
 * @param {*} deleteAdministrativeDTOS
 * @return: 成功则true CommonResponse 应答码和消息统一参考基础框架
 */
export function removeBatchAdministrative(deleteAdministrativeDTOS) {
  return request({
    url: ADMINISTRATIVE_URL + '/batch',
    data: deleteAdministrativeDTOS,
    method: 'delete',
  })
}
/**
 * 更多条件查询区域列表，一般用于查询区的查询按钮调用
 * @param {*} : 查询对象
 * @return:   CommonResponse<CommonPage<AdministrativeVO>>
 */
export function commonQuery(administrativeQuery) {
  return request({
    url: ADMINISTRATIVE_URL,
    method: 'get',
    params: administrativeQuery,
  })
}
/**
 *  根据id查找区域对象
 * @param {long} id  记录id
 */
export function queryAdministrativeById(id) {
  return request({
    url: ADMINISTRATIVE_URL + '/' + id,
    method: 'get',
  })
}

export function status(administrativeDTO) {
  return request({
    url: ADMINISTRATIVE_URL + '/status',
    method: 'put',
    data: administrativeDTO,
  })
}
